<template>
<div>
    <el-container>
    <el-aside width="100px">
        <div style=" margin-top: 40px; ">
          <el-menu  router class="el-menu-demo" >
            <el-menu-item   v-for="s in secuondMenu" :key="s.id+''" :index="s.id+''"
             :route="{path:'/'+s.link,query:{id:s.id+''}}" >{{s.typename}}</el-menu-item>
                
        </el-menu>
        </div>
        
    </el-aside>
    <el-main >
       <div>
        <router-view :key="$route.fullPath"/>
      </div>
    </el-main>
    </el-container>

</div>


  </template>
  
  <script>
  export default {
    data() {
        return {
            secuondMenu:[],
            //testMenu:[{id:'1',link:'gooddetail',typename:'11'},{id:'2',link:'gooddetail',typename:'22'}],
            typeId:''
        }
    },
    methods:{
        queryTypes(){
        this.$axios.get('api/app/GoodsType/queryGoodsType?parent='+this.typeId)
        .then(res =>{
          console.log(res.data.data)
          this.secuondMenu = res.data.data
        })
      }
    },
    created(){
        this.typeId = this.$route.query.id;
        console.log(this.typeId);
        this.queryTypes();
    }

  }
  </script>
  
  <style>
  
  </style>